Add support for time shifting inside the container#921
Draft
leighmcculloch wants to merge 6 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds container-wide time shifting support for Stellar Quickstart by integrating libfaketime and documenting how to control the fake time via /etc/faketimerc.
Changes:
- Install faketime-related packages in the image and preload libfaketime for all processes.
- Add a default
/etc/faketimercand passFAKETIME_NO_CACHEthrough to supervisord-launched services. - Document how to modify time in a running container via a bind-mounted faketimerc file.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
start |
Passes FAKETIME_NO_CACHE into the clean supervisord environment. |
dependencies |
Adds a faketime package to the apt install list. |
Dockerfile |
Attempts to symlink and preload libfaketime.so.1, sets FAKETIME_NO_CACHE=1, and copies /etc/faketimerc. |
faketimerc |
Introduces the default faketime configuration file content. |
README.md |
Documents time modification usage and examples. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
Author
|
Todo:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Install
faketimein the container image and configurelibfaketimeviald.so.preloadso all processes see the modified time. Expose time control through/etc/faketimerc, defaulting to+0(no modification). PassFAKETIME_NO_CACHEthrough to supervisord so changes take effect immediately. Document time manipulation via volume-mounted config, offset syntax, progressive jumps, and speed multipliers.Why
Testing time-sensitive Stellar network behavior (e.g. ledger close times, expiry) requires advancing the clock without affecting the host or restarting the container.
libfaketimeintercepts time calls at the libc level, making it transparent to all services.This probably doesn't allow for testing all time movement situations, but it's a simple way to provide some ability to do that with quickstart. Generally the soroban-sdk test framework is still the best place to codify tests that involve time changing.
Close stellar/stellar-protocol#1897